package top.chatgqt.SmartChargeStation.demo.netty.handlers;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;
import top.chatgqt.SmartChargeStation.demo.protobuf.UserProtobuf;

@Slf4j
public class ImoocServerProtobufHandler extends SimpleChannelInboundHandler<UserProtobuf.User> {

    private int count = 0;

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, UserProtobuf.User msg) throws Exception {

        count++;
        log.info(msg.getName() + "第{}次接收", count);
    }


}
